package com.sam.method;

import java.util.Arrays;

public class MethodTest {

	private static final String[] EMPTY = new String[0];

	public static void main(String[] args) {

		System.out.println(sum(1, 1, 11, 1));

		System.out.println(Arrays.asList("a", "c", "b"));

		System.out.println(Arrays.asList(1, 2, 3));

		System.out.println(new int[] { 1, 2, 3 });

		System.out.println(new String[] { "1", "2", "3" });

		System.out.println(Arrays.toString(new String[] { "1", "2", "3" }));

		
		
		
		System.out.println( Arrays.toString(toStringArray()));
		
	}

	public static String[] toStringArray(){
		
		return Arrays.asList("a", "c", "b").toArray(EMPTY);
		
		
		
		
		
		
	}
	
	
	
	
	
	
	
	
	public static int sum(int... args) {

		int sum = 0;

		for (int arg : args) {
			sum += arg;
		}

		return sum;

	}

}
